﻿using System;
using System.Collections.Generic;

public class Matrix4
{
    public double[,] matrix;

    public Matrix4()
    {
        this.matrix = new double[4, 4];
    }

    public static Matrix4 MakeSum(List<Matrix4> list)
    {
        Matrix4 m = new Matrix4();

        foreach (Matrix4 _m in list)
            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 4; j++)
                    m.matrix[i, j] += _m.matrix[i, j];

        return m;
    }

    public static Matrix4 operator +(Matrix4 u, Matrix4 v)
    {
        Matrix4 m = new Matrix4();

        for (int i = 0; i < 4; i++)
            for (int j = 0; j < 4; j++)
                m.matrix[i, j] = u.matrix[i, j] + v.matrix[i, j];

        return m;
    }

}